/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entities;

import java.io.Serializable;

/**
 *
 * @author frankkie
 */
public class CD implements Serializable {

  //private List<Uitlening> uitleningen;
  private String titel;
  private String artiest;
  private Uitlening uitlening;

  //public List<Uitlening> getUitleningenVanCd() {
  //return uitleningen;
  // }
  public void setArtiest(String artiest) {
    this.artiest = artiest;
  }

  public void setUitlening(Uitlening uitlening) {
    this.uitlening = uitlening;
  }

  public void removeUitlening() {
    this.uitlening = null;
  }

  @Override
  //@SuppressWarnings("EqualsWhichDoesntCheckParameterClass")
  public boolean equals(Object o) {
    //NIET HASHCODE OVERRIDE !!
    if (o instanceof CD) {
      if (this.hashCode() == o.hashCode()){
        return true;
      }
    }
    return false;
  }

  /*
   * NIET GEBRUIKEN !!
   * STAAT NIET IN DE UML !!
  @Override
  public int hashCode() {
    int hash = 7;
    hash = 53 * hash + (this.titel != null ? this.titel.hashCode() : 0);
    hash = 53 * hash + (this.artiest != null ? this.artiest.hashCode() : 0);
    hash = 53 * hash + (this.uitlening != null ? this.uitlening.hashCode() : 0);
    return hash;
  }*/

  public String getArtiest() {
    return artiest;
  }

  public void setTitel(String titel) {
    this.titel = titel;
  }

  public Uitlening getUitlening() {
    return uitlening;
  }

  public String getTitel() {
    return titel;
  }

  @Override
  public String toString() {
    return getArtiest() + " - " + getTitel();
  }
}
